package com.heima.feign.config;

import com.heima.feign.client.WmUserFeignClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.model.wemedia.entity.WmUser;
import org.springframework.cloud.openfeign.FallbackFactory;

public class WmUserFeignClientFallbackFactory implements FallbackFactory<WmUserFeignClient> {


    @Override
    public WmUserFeignClient create(Throwable cause) {

        return new WmUserFeignClient() {
            @Override
            public ResponseResult save(WmUser wmUser) {
                return ResponseResult.errorResult(AppHttpCodeEnum.SERVER_ERROR);
            }
        };
    }
}

